app.controller('claimHouseCtrl', function($element, ngDialog, $scope, $state, rest, user, uploadConf, tipService, uiLoad, $localStorage, $window) {
  var data = angular.copy($scope.ngDialogData, {});
  var token = $window.localStorage.getItem("token");

  $scope.params = {
    houseIds: data.houseId,
  };

  //点击确定按钮
  $scope.modifySure = function() {
    rest.decoJava({
      url: '/tenancy-sys/admin/house/updateHouseAssigneds',
      data: $scope.params,
      type: 'post',
      beforeSend: function(request) {
        request.setRequestHeader("token", token);
      },
      success: function(res) {
        if (res.code == 0) {
          $scope.closeThisDialog({
            clickOk: true
          });
        } else {
          tipService.show("body", {
            message: "认领失败",
            notice: "danger"
          }, 3);
          return;
        }
      },
      error: function() {
        // btn.removeClass('disabled');
      }
    });
  }

});